package com.edu.action;

import com.edu.entity.Product;
import com.edu.service.ProductService;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ProductAction extends ActionSupport implements ModelDriven<Product> {

	//模型驱动
	private Product product=new Product();
	@Override
	public Product getModel() {
		
		return product;
	}
	
	//struts与spring整合
	private ProductService productService;

	public void setProductService(ProductService productService) {
		this.productService = productService;
	}
	
	public String save(){
		System.out.println("执行action中的save方法");
		productService.save(product);
		return NONE;
	}


	
}
